extends "../hude-3/hude-3.gd"


var baseId = ""
var upText1 = "皇家荣耀额外赋予皇家阵营角色3层<振奋>"
var upText2 = "皇家战旗效果系数+5%"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("将自身的装备(三维射速暴击爆伤血量)的[25%]加持给全体队友(含召唤物)", "皇家战旗")

var attr
func _upS():
	._upS()	
	doSnzq()

func doSnzq():
	var ally = getAllChas(2)
	attr = BaseAttr.new(items, upgraded)
	for i in ally:
		if not i.hasBuff("b_hude"):
			i.addBuff(b_hude.new(attr))

class b_hude:
	extends "../../../azurlane_ctrl/AzurBuff.gd"
	func _init(attr:BaseAttr):
		attInit()
		buffName = "皇家战旗"
		dispel = 2
		id = "b_hude"
		att.atk = attr.atk
		att.mgiAtk = attr.mgiAtk
		att.def = attr.def
		att.maxHp = attr.maxHp
		att.criR = attr.criR
		att.cri = attr.cri

class BaseAttr:
	var atk = 0
	var mgiAtk = 0
	var def = 0
	var maxHp = 0
	var criR = 0
	var cri = 0
	var p = 0.25
	func _init(items, upgraded):
		if upgraded == 2:
			p = 0.3
		for i in items:
			atk += i.att.atk*p
			mgiAtk += i.att.mgiAtk*p
			def += i.att.def*p
			maxHp += i.att.maxHp*p
			criR += i.att.criR*p
			cri += i.att.cri*p